<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <video src=""></video>
</body>
<script>
    var constraints = {audio:false,video:{width:1280,height:720}};
    navigator.mediaDevices.getUserMedia(constraints).then(function(mediaStream){
        var video = document.querySelector('video');
        video.srcObject = mediaStream;
        video.onloadedmetadata = function(e){
            video.play();
        };
    })
    .catch(function(err){
        console.log(err.name+ ":"+err.message);
    })
</script>
</html>